package com.twu.biblioteca;

import java.util.LinkedList;
import java.util.List;

class BookRepository {

    private final List<String> books = new LinkedList<>();

    void add(String book) {
        books.add(book);
    }

    void add(Book book) {
        books.add(book.getTitle());
    }

    List<Book> findAll() {
        List<Book> result = new LinkedList<>();
        for (String book : books) {
            result.add(new Book(book));
        }
        return result;
    }

}
